import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../controllers/video_list_controller.dart';

import '../common/routes.dart';

class VideoListPage extends StatelessWidget {
  const VideoListPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        title: Image.asset(
          'assets/images/eyepetizer.png',
          fit: BoxFit.contain,
          width: 120,
          height: 25,
        ),
        centerTitle: true,
      ),
      body: GetBuilder<VideoListController>(
          init: VideoListController(),
          builder: (_) {
            return Column(
              children: [
                GestureDetector(
                  child: Container(
                    margin: EdgeInsets.all(10),
                    height: 160,
                    width: double.infinity,
                    child: Stack(
                      children: [
                        ClipRRect(
                          borderRadius: BorderRadius.circular(10),
                          child: Image.asset(
                            "assets/images/bg_3.webp",
                            fit: BoxFit.cover,
                            width: double.infinity,
                          ),
                        ),
                        Container(
                          decoration: BoxDecoration(
                            color: Colors.black.withAlpha(127),
                            borderRadius: BorderRadius.circular(10),
                          ),
                        ),
                        Center(
                          child: Text(
                            "发现视频",
                            style: TextStyle(color: Colors.white, fontSize: 18),
                          ),
                        )
                      ],
                    ),
                  ),
                  onTap: () {
                    Get.toNamed(Routes.DISCOVER);
                  },
                ),
                GestureDetector(
                  child: Container(
                    margin: EdgeInsets.all(10),
                    height: 160,
                    width: double.infinity,
                    child: Stack(
                      children: [
                        ClipRRect(
                          borderRadius: BorderRadius.circular(10),
                          child: Image.asset(
                            "assets/images/bg_4.jpg",
                            fit: BoxFit.cover,
                            width: double.infinity,
                          ),
                        ),
                        Container(
                          decoration: BoxDecoration(
                            color: Colors.black.withAlpha(127),
                            borderRadius: BorderRadius.circular(10),
                          ),
                        ),
                        Center(
                          child: Text(
                            "推荐视频",
                            style: TextStyle(color: Colors.white, fontSize: 18),
                          ),
                        )
                      ],
                    ),
                  ),
                  onTap: () {
                    Get.toNamed(Routes.COMMUNITY);
                  },
                ),
                GestureDetector(
                  child: Container(
                    margin: EdgeInsets.all(10),
                    height: 160,
                    width: double.infinity,
                    child: Stack(
                      children: [
                        ClipRRect(
                          borderRadius: BorderRadius.circular(10),
                          child: Image.asset(
                            "assets/images/bg_5.jpg",
                            fit: BoxFit.cover,
                            width: double.infinity,
                          ),
                        ),
                        Container(
                          decoration: BoxDecoration(
                            color: Colors.black.withAlpha(127),
                            borderRadius: BorderRadius.circular(10),
                          ),
                        ),
                        Center(
                          child: Text(
                            "视频排行榜",
                            style: TextStyle(color: Colors.white, fontSize: 18),
                          ),
                        )
                      ],
                    ),
                  ),
                  onTap: () {
                    Get.toNamed(Routes.VIDEO_RANK);
                  },
                )
              ],
            );
          }),
    );
  }
}
